#include<iostream>
#include<algorithm>
using namespace std;
typedef long long LL;
int n, a, b;
int main()
{
	int t;
	cin >> t;
	while (t--) {
		cin >> a >> b >> n;
		LL ans = 0;
		if (n & 1) {
			int x = (n + 1) / 2;
			int y = x - 1;
			ans = x * b * 1ll + 1ll * y * (a + abs(a - b));
		}
		else {
			if (n == 2 || a <= b) {
				ans = b * n * 1ll;
			}
			else {
				ans = b * n * 1ll + (a - b) * 1ll * ((n - 2) / 2);
			}
		}
		cout << ans << endl;
	}
	return 0;
}
